<meta charset="UTF-8"/>
<script>
    var arr=["america","China","Greece","Britain","Canada","Egypt"]//在以下字符中: America Greece Britain Canada China Egypt
    var count=0;
    for (var i=0;i<arr.length;i++){
        if(arr[i].indexOf("a")!=-1||arr[i].indexOf("A")!=-1){
            count++;
        }
    }
    alert("字符中查找到a或A的个数为："+count);
</script>